package com.lc.docdeal.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lc.docdeal.bean.FileUpload;

import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.UnsupportedEncodingException;

public interface FileUploadService extends IService<FileUpload> {

    /**
     * 根据id查询文件
     * @param id
     * @return
     */
    FileUpload findById(Integer id);

    /**
     * 根据id删除文件
     * @param id
     * @return
     */
    boolean remove(Integer id);

    /**
     * oss文件上传
     * @param uploadFile
     * @return
     */
    public String upload(File uploadFile);

    /**
     * oss文件下载
     * @param fileName
     * @param response
     * @return
     * @throws UnsupportedEncodingException
     */
    public String download(String fileName, HttpServletResponse response) throws UnsupportedEncodingException;

    /**
     * oss文件删除
     * @param fileName
     * @return
     */
    public String delete(String fileName);
}
